package behaviorPattern.mediator.SimpleMediatorPattern.v3;

/**
 * @Author: Alex Hu
 * Date: 2020/2/22 6:55 下午
 * Content:
 */


/**
 * 具体同事类
 *
 * @author Alex Hu
 */
public class SimpleConcreteColleague1 implements SimpleColleague {
    protected SimpleConcreteColleague1() {
        SimpleMediator smd = SimpleMediator.getMedium();
        smd.register(this);
    }

    @Override
    public void receive() {
        System.out.printf("具体同事类1,实例： %s ：收到请求。\n",this);
    }

    @Override
    public void send() {
        SimpleMediator smd = SimpleMediator.getMedium();
        System.out.printf("具体同事类1,实例： %s ：发出请求...\n",this);
        /**请中介者转发*/
        smd.relay(this);
    }
}

